//猜数字游戏
#include<stdio.h>
#include<time.h>
#include<stdlib.h>
void menu(){
    printf("******game*******\n");
    printf("******1.play*******\n");
    printf("******0.exit*******\n");
}
int main(){
    srand(time(NULL));
    int num = rand()%10 +1;
    menu();
    int choose = 1;
    scanf("%d",&choose);
    while(1){
        if (choose == 0){
            printf("游戏结束！\n");
            break;
        }
        else if(choose == 1){
            int guess_num = 0;
            printf("请输入你的数字：\n");
            scanf("%d",&guess_num);
            if (guess_num == num){
                printf("你猜对了！\n");
                break;
            }
            else{
                if (guess_num < num){
                    printf("你猜小了！\n");
                }else {
                    printf("你猜大了！\n");
                }
                continue;
            }
        }
    }
}